import 'package:get/get.dart';

mixin IntlBase {
  String get en => "";
  String get zh => "";
  String get tr => toString().tr;

  String args(List<String> args) {
    return toString().trArgs(args);
  }
  String trParams([Map<String, String> params = const {}]) {
    return toString().trParams(params);
  }

  static Map<String, String> enIntl<T extends IntlBase>(List<T> values) {
    return values.fold({}, (prev, ele) {
      prev[ele.tr] = ele.en;
      return prev;
    });
  }

  static Map<String, String> zhIntl<T extends IntlBase>(List<T> values) {
    return values.fold({}, (prev, ele) {
      prev[ele.tr] = ele.zh;
      return prev;
    });
  }
}
